/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author GiangLT
 */
@Embeddable
public class BoSoTrungThuongPK implements Serializable {

    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "MA_TINH")
    private String maTinh;
    @Basic(optional = false)
    @NotNull
    @Column(name = "NGAY_QUAY")
    @Temporal(TemporalType.TIMESTAMP)
    private Date ngayQuay;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "BO_SO")
    private String boSo;

    public BoSoTrungThuongPK() {
    }

    public BoSoTrungThuongPK(String maTinh, Date ngayQuay, String boSo) {
        this.maTinh = maTinh;
        this.ngayQuay = ngayQuay;
        this.boSo = boSo;
    }

    public String getBoSo() {
        return boSo;
    }

    public void setBoSo(String boSo) {
        this.boSo = boSo;
    }

    public String getMaTinh() {
        return maTinh;
    }

    public void setMaTinh(String maTinh) {
        this.maTinh = maTinh;
    }

    public Date getNgayQuay() {
        return ngayQuay;
    }

    public void setNgayQuay(Date ngayQuay) {
        this.ngayQuay = ngayQuay;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BoSoTrungThuongPK)) {
            return false;
        }
        BoSoTrungThuongPK other = (BoSoTrungThuongPK) object;
        if ((this.maTinh == null && other.maTinh != null) || (this.maTinh != null && !this.maTinh.equals(other.maTinh))) {
            return false;
        }
        if ((this.ngayQuay == null && other.ngayQuay != null) || (this.ngayQuay != null && !this.ngayQuay.equals(other.ngayQuay))) {
            return false;
        }
        if ((this.boSo == null && other.boSo != null) || (this.boSo != null && !this.boSo.equals(other.boSo))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (maTinh != null ? maTinh.hashCode() : 0);
        hash += (ngayQuay != null ? ngayQuay.hashCode() : 0);
        hash += (boSo != null ? boSo.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.BoSoTrungThuongPK[ maTinh=" + maTinh + ", ngayQuay=" + ngayQuay + ", boSo=" + boSo + " ]";
    }
}
